<%@ page import="java.text.SimpleDateFormat" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="../../../css/bootstrap.css">
    <script src="../../../js/jquery-3.2.1.min.js"></script>
    <script src="../../../js/bootstrap.js"></script>

</head>
<body>



<div id="main">

    <!--上面布局-->
<%--    <div style="height: 100px"></div>--%>
    <div class="col-xs-1"></div>
    <div class="col-xs-10">
        <div class="alert alert-danger" role="alert">
            <div class="page-header">
                <h1>${user.companyName} <small> ${user.userName},您好</small></h1>
            </div>
        </div>
        <div class="alert alert-warning" role="alert">
            <table class="table table-bordered ">
                <tr>
                    <th><h3>序号</h3></th>
                    <th><h3>发件人</h3></th>
                    <th><h3>反馈内容</h3></th>
                    <th><h3>时间</h3></th>
                    <th><h3>操作</h3></th>
                </tr>

                <% int count = 1;%>
                <c:forEach items="${list}" var="Opinion">
                    <tr>
                        <td><%=count++%><input type="checkbox" onclick="deleteIdeas('${Opinion.id}')"></td>
                        <td>${Opinion.userName}</td>
                        <td>${Opinion.idea}</td>
                        <td>${Opinion.time}</td>
                        <td>
                            <button class="btn btn-sm btn-danger" onclick="deleteIdea('${Opinion.id}')">删除</button>

                        </td>
                    </tr>

                    <script>

                        /*获取单个id*/
                        function deleteIdea(id) {
                            location.href = "${pageContext.request.contextPath}/opinion/deleteIdea.do?id=" + id;
                        }

                        /*获取多个id*/
                        function deleteIdeas(ids) {
                            location.href = "${pageContext.request.contextPath}/opinion/deleteIdeas.do?ids=" + ids;
                        }


                    </script>

                </c:forEach>
            </table>


            <div class="col-xs-10"></div>
            <div class="col-xs-2">
                <p><a class="btn btn-success btn-lg" href="${pageContext.request.contextPath}/opinion/toHome.do" role="button">返回</a></p>

            </div>


            <br>
            <br>
            <br>
        </div>



    </div>
    <div class="col-xs-1"></div>


</div>
</body>


</html>
